import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css';

const routes: Array<RouteRecordRaw> = [{
    path: '/',
    name: 'home',
    component: () => import(/* webpackChunkName: "home" */ '../views/home/index.vue'),
    meta: {},
    children: [],
}]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

router.beforeEach(async (_to, _from, next) => {
    NProgress.start();
    next();
})

router.afterEach(() => {
    NProgress.done();
});

export default router;